﻿// ********************************
// 2010.11.02
// Station Base Type
// Author:卢融凯
// ********************************
using System;
using System.Drawing;
using System.Net;
using SManage.Infrastructure;

namespace SManage.Control
{
    [Serializable]
    public class StationBase:IStation
    {
        protected StationType _stationType = StationType.Router;
        private String _name;
        private String _description;
        protected Image _image;
        private IPAddress _ipAddress;
        private String _subMask;

        /// <summary>
        /// Station type
        /// </summary>
        public virtual StationType Type {
            get {
                return _stationType;                
            }
            set {
                _stationType = value;
            }
        }

        /// <summary>
        /// Station name.
        /// </summary>
        public String Name
        {
            get { return _name ?? (_name = "[None]"); }
            set {
                _name = value;
            }
        }

        /// <summary>
        /// Station description
        /// </summary>
        public String Description
        {
            get { return _description ?? (_description = "No description."); }
            set {
                _description = value;
            }
        }

        /// <summary>
        /// Station image
        /// </summary>
        public virtual Image Image
        {
            get { return _image ?? (_image = StationResource.Router); }
            set {
                _image = value;
            }
        }

        /// <summary>
        /// Station ip address
        /// </summary>
        public IPAddress IPAddress 
        {
            get { return _ipAddress ?? (_ipAddress = IPAddress.Parse("0.0.0.0")); }
            set {
                _ipAddress = value;
            }
        }

        /// <summary>
        /// Station submask
        /// </summary>
        public string SubMask
        {
            get { return _subMask ?? (_subMask = "255.255.255.255"); }
            set {
                _subMask = value;
            }
        }
    }
}
